﻿<?php $this->load->view('common/admin_header');?>
<div class="block">
  <div class="block_head">
    <div class="bheadl"></div>
    <div class="bheadr"></div>
    <h2><?=$lang['orders_lable_39']?></h2>
    <ul>
      <li><a href="<?=site_url('admins/orders').'?'.base64_decode($this->input->cookie('url_query'))?>"><?=$lang['orders_lable_48']?></a></li>
    </ul>
  </div>
  <!-- .block_head ends -->
  <div class="block_content">
    <?php if(isset($list_one) && !empty($list_one) && is_array($list_one)){extract($list_one);}?>
    <table class="sortable table-bordered" width="100%">
      <tbody>
        <tr>
          <td><b><?=$lang['orders_lable_40']?>:</b></td>
          <td><?=isset($nickname)?$nickname:''?></td>
          <td><b><?=$lang['orders_lable_41']?>:</b></td>
          <td><?=isset($phone)?$phone:''?></td>
        </tr>
        <tr>
          <td><b><?=$lang['orders_lable_42']?>:</b></td>
          <td><?=isset($invoice_no)?$invoice_no:''?></td>
          <td><b><?=$lang['orders_lable_43']?>:</b></td>
          <td>
          <?php if($order_way==1){echo $lang['orders_lable_68'];}else if($order_way==2){echo $lang['orders_lable_69'];}else{echo $order_way;}?>
            
          </td>
        </tr>
        <?php if(isset($order_way)&&$order_way==2):?>
        <tr>
          <td><b><?=$lang['orders_lable_72']?>:</b></td>
          <td><?=isset($order_time)?$order_time:''?></td>
          <td><b><?=$lang['orders_lable_73']?>:</b></td>
          <td><?=isset($address)?$address:''?></td>
        </tr>
        <?php endif;?>
        <tr>
          <td><b><?=$lang['orders_lable_44']?>:</b></td>
<!--          <td>--><?//=isset($order_status_id)&&$order_status_id==1?'待處理':'已完成'?><!--</td>-->
          <td><?php if(isset($order_status_id)&&$order_status_id==1){ echo $lang['orders_lable_64'];}
          elseif(isset($order_status_id)&&$order_status_id==2){ echo $lang['orders_lable_65'];}
          elseif(isset($order_status_id)&&$order_status_id==3){ echo $lang['orders_lable_66'];}
          elseif(isset($order_status_id)&&$order_status_id==4){ echo $lang['orders_lable_67'];}
          ?></td>
          <td><b><?=$lang['orders_lable_45']?>:</b></td>
          <td><?=isset($total)?'$'.$total:''?></td>
        </tr>
        <tr>
          <td><b><?=$lang['orders_lable_46']?>:</b></td>
          <td><?=isset($update_time) && !empty($update_time)?date($format_time,$update_time):''?></td>
          <td><b><?=$lang['orders_lable_11']?>:</b></td>
          <td><?=isset($add_time) && !empty($add_time)?date($format_time,$add_time):''?></td>
        </tr>
        <tr>
          <td><b><?=$lang['orders_lable_47']?>:</b></td>
          <td ><?=isset($comment)?nl2br($comment):''?></td>
          <td><b><?=$lang['orders_lable_13']?>:</b></td>
          <td ><?php echo $pay_status == 1 ? $lang['orders_lable_70'] : $lang['orders_lable_71'] ?></td>
        </tr>
        <tr>
          <td><b><?=$lang['orders_lable_54']?>:</b></td>
          <td ><?=isset($table_num)?nl2br($table_num):''?></td>
          <td><b></b></td>
          <td ></td>
        </tr>
      </tbody>
    </table>    
  </div>
  <!-- .block_content ends -->
  <div class="bendl"></div>
  <div class="bendr"></div>
</div>
<!-- .block ends -->
<div class="block">
  <div class="block_head">
    <div class="bheadl"></div>
    <div class="bheadr"></div>
    <h2><?=$lang['orders_lable_49']?></h2>
    <ul>
      <li><a href="<?=site_url('admins/orders').'?'.base64_decode($this->input->cookie('url_query'))?>"><?=$lang['orders_lable_48']?></a></li>
    </ul>
  </div>
  <!-- .block_head ends -->
  <div class="block_content">
    <table cellpadding="0" cellspacing="0" width="100%" class="sortable table">
      <thead>
        <tr>
          <th><?=$lang['orders_lable_50']?></th>
          <th><?=$lang['orders_lable_89']?></th>
          <th><?=$lang['orders_lable_51']?></th>
          <th><?=$lang['orders_lable_52']?></th>
        </tr>
      </thead>
      <?php if(isset($products) && $products->num_rows()>0):?>
      <?php foreach($products->result_array() as $list):?>
      <tr>
        <td title="<?=$list['name']?>">
          <?=$list['name']?>
        </td>
        <td>
           <?php $totle_fee=0;?>
           <?php if($list['attrs']):?>
           <?php $attrs = unserialize($list['attrs']);foreach($attrs as $attr):
               $totle_fee+=$attr['price'];
           ?>
           <span><?=$attr['name']?><?=$attr['num']?><?=$list['model']?></span> 
           <?php endforeach;?>
           <?php else:?>
            N
           <?php endif;?>
        </td>
        <td><?=$list['quantity']?></td>
<!--        <td>$--><?//=number_format(floatval($list['price']))?><!--</td>-->
        <td>$<?=number_format(floatval($list['price']+$totle_fee))?></td>

      </tr>
      <?php endforeach;?>
      <tr>
        <td align="right" colspan="3"><b><?=$lang['orders_lable_53']?>:</b></td>
        <td><?=isset($total)?'$'.$total:''?></td>
      </tr>
      <?php else:?>
      <tr>
        <td colspan="10" class="nodata"><p><?=$lang['global_lable_42']?></p></td>
      </tr>
      <?php endif;?>
    </table>
  </div>
  <!-- .block_content ends -->
  <div class="bendl"></div>
  <div class="bendr"></div>
</div>
<!-- .block ends -->
<?php $this->load->view('common/admin_footer');?>
